import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.fisco.bcos.sdk.abi.FunctionReturnDecoder;
import org.fisco.bcos.sdk.abi.TypeReference;
import org.fisco.bcos.sdk.abi.datatypes.Event;
import org.fisco.bcos.sdk.abi.datatypes.Function;
import org.fisco.bcos.sdk.abi.datatypes.Type;
import org.fisco.bcos.sdk.abi.datatypes.Utf8String;
import org.fisco.bcos.sdk.abi.datatypes.generated.Uint256;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple1;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple2;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple3;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple4;
import org.fisco.bcos.sdk.abi.datatypes.generated.tuples.generated.Tuple5;
import org.fisco.bcos.sdk.client.Client;
import org.fisco.bcos.sdk.contract.Contract;
import org.fisco.bcos.sdk.crypto.CryptoSuite;
import org.fisco.bcos.sdk.crypto.keypair.CryptoKeyPair;
import org.fisco.bcos.sdk.eventsub.EventCallback;
import org.fisco.bcos.sdk.model.CryptoType;
import org.fisco.bcos.sdk.model.TransactionReceipt;
import org.fisco.bcos.sdk.model.callback.TransactionCallback;
import org.fisco.bcos.sdk.transaction.model.exception.ContractException;

@SuppressWarnings("unchecked")
public class RentHouse extends Contract {
    public static final String[] BINARY_ARRAY = {"608060405234801561001057600080fd5b506001600081905550600180819055506114398061002f6000396000f300608060405260043610610083576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301cf60a9146100885780634d49a2761461020d57806397a3d860146102cf578063ab60098514610392578063af0684ae146103d3578063f8a8f10e1461046e578063fb63de1d146104c3575b600080fd5b34801561009457600080fd5b506100b36004803603810190808035906020019092919050505061054a565b60405180858152602001806020018060200180602001848103845287818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b50848103835286818151815260200191508051906020019080838360005b8381101561016757808201518184015260208101905061014c565b50505050905090810190601f1680156101945780820380516001836020036101000a031916815260200191505b50848103825285818151815260200191508051906020019080838360005b838110156101cd5780820151818401526020810190506101b2565b50505050905090810190601f1680156101fa5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34801561021957600080fd5b5061023860048036038101908080359060200190929190505050610797565b6040518086815260200185815260200184815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610290578082015181840152602081019050610275565b50505050905090810190601f1680156102bd5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390f35b3480156102db57600080fd5b5061037c600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506108c3565b6040518082815260200191505060405180910390f35b34801561039e57600080fd5b506103bd60048036038101908080359060200190929190505050610af0565b6040518082815260200191505060405180910390f35b3480156103df57600080fd5b506104586004803603810190808035906020019092919080359060200190929190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929080359060200190929190505050610c9f565b6040518082815260200191505060405180910390f35b34801561047a57600080fd5b506104ad600480360381019080803590602001909291908035906020019092919080359060200190929190505050610f25565b6040518082815260200191505060405180910390f35b3480156104cf57600080fd5b5061053460048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611034565b6040518082815260200191505060405180910390f35b6000606080606061055961128f565b600260008781526020019081526020016000206080604051908101604052908160008201548152602001600182018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561061b5780601f106105f05761010080835404028352916020019161061b565b820191906000526020600020905b8154815290600101906020018083116105fe57829003601f168201915b50505050508152602001600282018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106bd5780601f10610692576101008083540402835291602001916106bd565b820191906000526020600020905b8154815290600101906020018083116106a057829003601f168201915b50505050508152602001600382018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561075f5780601f106107345761010080835404028352916020019161075f565b820191906000526020600020905b81548152906001019060200180831161074257829003601f168201915b505050505081525050905080600001518160200151826040015183606001518292508191508090509450945094509450509193509193565b6000806000606060006107a86112b8565b6003600088815260200190815260200160002060a06040519081016040529081600082015481526020016001820154815260200160028201548152602001600382018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561087e5780601f106108535761010080835404028352916020019161087e565b820191906000526020600020905b81548152906001019060200180831161086157829003601f168201915b50505050508152602001600482015481525050905080600001518160200151826040015183606001518460800151819150955095509550955095505091939590929450565b60006108cd61128f565b60806040519081016040528060005481526020018581526020018481526020016040805190810160405280600981526020017fe69caae587bae7a79f000000000000000000000000000000000000000000000081525081525090508060026000805481526020019081526020016000206000820151816000015560208201518160010190805190602001906109639291906112e8565b5060408201518160020190805190602001906109809291906112e8565b50606082015181600301908051906020019061099d9291906112e8565b50905050600460005490806001815401808255809150509060018203906000526020600020016000909192909190915055507fdcf5f4f3e07922a5fb2332be064c8df3fb899e5c649bc6bc20233ac753f6c49784600054604051808060200180602001848152602001838103835285818151815260200191508051906020019080838360005b83811015610a3e578082015181840152602081019050610a23565b50505050905090810190601f168015610a6b5780820380516001836020036101000a031916815260200191505b50838103825260218152602001807fe6b7bbe58aa0e4ba86e4b880e4b8aae688bfe6ba90efbc8ce688bfe5ad90494481526020017f3a0000000000000000000000000000000000000000000000000000000000000081525060400194505050505060405180910390a16000808154809291906001019190505550600091505092915050565b6000806000600260008581526020019081526020016000206001019150600190505b600480549050811015610b735783600482815481101515610b2f57fe5b90600052602060002001541415610b6657600481815481101515610b4f57fe5b906000526020600020016000905560009250610c98565b8080600101915050610b12565b7fdba6e1cb9ac671042eb1b416cc20bd0eb184df1b5a586bd7bada650e4165f6768285604051808060200180602001848152602001838103835285818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610c295780601f10610bfe57610100808354040283529160200191610c29565b820191906000526020600020905b815481529060010190602001808311610c0c57829003601f168201915b5050838103825260218152602001807fe588a0e999a4e4ba86e4b880e4b8aae688bfe6ba90efbc8ce688bfe5ad90494481526020017f3a0000000000000000000000000000000000000000000000000000000000000081525060400194505050505060405180910390a1600092505b5050919050565b6000610ca96112b8565b60a06040519081016040528060015481526020018781526020018681526020018581526020018481525090506040805190810160405280600981526020017fe5b7b2e587bae7a79f0000000000000000000000000000000000000000000000815250600260008581526020019081526020016000206003019080519060200190610d34929190611368565b50806003600060015481526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003019080519060200190610d859291906112e8565b5060808201518160040155905050600560015490806001815401808255809150509060018203906000526020600020016000909192909190915055507fa9f382359876204154179a0c98cda5bc926a7a1e85ad81301cb0ab0eb6841140846001546000548989604051808060200180602001878152602001868152602001858152602001848152602001838103835288818151815260200191508051906020019080838360005b83811015610e47578082015181840152602081019050610e2c565b50505050905090810190601f168015610e745780820380516001836020036101000a031916815260200191505b508381038252605e8152602001807fe7a79fe8b581e4ba86e4b880e4b8aae688bfe5ad90efbc8ce59088e5908c494481526020017fe38081e688bfe5ad904944e38081e7a79fe98791efbc88e69c88efbc89e3808181526020017fe7a79fe8b581e697b6e995bfefbc88e69c88efbc89e58886e588abe4b8ba000081525060600197505050505050505060405180910390a16001600081548092919060010191905055506000915050949350505050565b60008260036000868152602001908152602001600020600101819055508160036000868152602001908152602001600020600201819055507f91dc57f67c2c4296727523a3a1c7a8c520245b0b0f06d5cd87ae20bc76e61c4d8484846040518080602001858152602001848152602001838152602001828103825260538152602001807fe69bb4e696b0e4ba86e4b880e4b8aae59088e5908ce4bfa1e681afefbc8ce59081526020017f88","e5908c4944e38081e7a79fe98791efbc88e69c88efbc89e38081e7a79fe8b581526020017f81e697b6e995bfefbc88e69c88efbc89efbc9a0000000000000000000000000081525060600194505050505060405180910390a1600090509392505050565b60006060600260008581526020019081526020016000206001018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110e25780601f106110b7576101008083540402835291602001916110e2565b820191906000526020600020905b8154815290600101906020018083116110c557829003601f168201915b5050505050905082600260008681526020019081526020016000206002019080519060200190611113929190611368565b507fc4eb04393042a0f631aabedd0e9beaec71354da51284a4a1466f88065668a7a281858560405180806020018060200185815260200180602001848103845287818151815260200191508051906020019080838360005b8381101561118657808201518184015260208101905061116b565b50505050905090810190601f1680156111b35780820380516001836020036101000a031916815260200191505b50848103835260278152602001807fe69bb4e696b0e4ba86e4b880e4b8aae688bfe6ba90e4bfa1e681afefbc8ce68881526020017fbfe5ad9049443a00000000000000000000000000000000000000000000000000815250604001848103825285818151815260200191508051906020019080838360005b8381101561124657808201518184015260208101905061122b565b50505050905090810190601f1680156112735780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a1600091505092915050565b608060405190810160405280600081526020016060815260200160608152602001606081525090565b60a06040519081016040528060008152602001600081526020016000815260200160608152602001600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061132957805160ff1916838001178555611357565b82800160010185558215611357579182015b8281111561135657825182559160200191906001019061133b565b5b50905061136491906113e8565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106113a957805160ff19168380011785556113d7565b828001600101855582156113d7579182015b828111156113d65782518255916020019190600101906113bb565b5b5090506113e491906113e8565b5090565b61140a91905b808211156114065760008160009055506001016113ee565b5090565b905600a165627a7a7230582041bd890b568579552d5dfb3678cab3fab443610e1dae09726c182998f47693820029"};

    public static final String BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", BINARY_ARRAY);

    public static final String[] SM_BINARY_ARRAY = {};

    public static final String SM_BINARY = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", SM_BINARY_ARRAY);

    public static final String[] ABI_ARRAY = {"[{\"constant\":true,\"inputs\":[{\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"selHouseById\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"string\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"selOrderById\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"uint256\"},{\"name\":\"\",\"type\":\"string\"},{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_homeOwner\",\"type\":\"string\"},{\"name\":\"_infor\",\"type\":\"string\"}],\"name\":\"addHouse\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_id\",\"type\":\"uint256\"}],\"name\":\"delHouse\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_rentInfor\",\"type\":\"uint256\"},{\"name\":\"_time\",\"type\":\"uint256\"},{\"name\":\"_tenant\",\"type\":\"string\"},{\"name\":\"_houseId\",\"type\":\"uint256\"}],\"name\":\"addOrder\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_id\",\"type\":\"uint256\"},{\"name\":\"_rentInfor\",\"type\":\"uint256\"},{\"name\":\"_time\",\"type\":\"uint256\"}],\"name\":\"updOrder\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"name\":\"_id\",\"type\":\"uint256\"},{\"name\":\"_infor\",\"type\":\"string\"}],\"name\":\"updHouse\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"info\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"AddHouse\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"info\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"DelHouse\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"info\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"_information\",\"type\":\"string\"}],\"name\":\"UpdHouse\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"name\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"info\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"_houseId\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"_rent\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"_time\",\"type\":\"uint256\"}],\"name\":\"AddOrder\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"name\":\"info\",\"type\":\"string\"},{\"indexed\":false,\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"_rentInfor\",\"type\":\"uint256\"},{\"indexed\":false,\"name\":\"_time\",\"type\":\"uint256\"}],\"name\":\"UpdOrder\",\"type\":\"event\"}]"};

    public static final String ABI = org.fisco.bcos.sdk.utils.StringUtils.joinAll("", ABI_ARRAY);

    public static final String FUNC_SELHOUSEBYID = "selHouseById";

    public static final String FUNC_SELORDERBYID = "selOrderById";

    public static final String FUNC_ADDHOUSE = "addHouse";

    public static final String FUNC_DELHOUSE = "delHouse";

    public static final String FUNC_ADDORDER = "addOrder";

    public static final String FUNC_UPDORDER = "updOrder";

    public static final String FUNC_UPDHOUSE = "updHouse";

    public static final Event ADDHOUSE_EVENT = new Event("AddHouse", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event DELHOUSE_EVENT = new Event("DelHouse", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event UPDHOUSE_EVENT = new Event("UpdHouse", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}));
    ;

    public static final Event ADDORDER_EVENT = new Event("AddOrder", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
    ;

    public static final Event UPDORDER_EVENT = new Event("UpdOrder", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
    ;

    protected RentHouse(String contractAddress, Client client, CryptoKeyPair credential) {
        super(getBinary(client.getCryptoSuite()), contractAddress, client, credential);
    }

    public static String getBinary(CryptoSuite cryptoSuite) {
        return (cryptoSuite.getCryptoTypeConfig() == CryptoType.ECDSA_TYPE ? BINARY : SM_BINARY);
    }

    public Tuple4<BigInteger, String, String, String> selHouseById(BigInteger _id) throws ContractException {
        final Function function = new Function(FUNC_SELHOUSEBYID, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_id)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple4<BigInteger, String, String, String>(
                (BigInteger) results.get(0).getValue(), 
                (String) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (String) results.get(3).getValue());
    }

    public Tuple5<BigInteger, BigInteger, BigInteger, String, BigInteger> selOrderById(BigInteger _id) throws ContractException {
        final Function function = new Function(FUNC_SELORDERBYID, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_id)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}));
        List<Type> results = executeCallWithMultipleValueReturn(function);
        return new Tuple5<BigInteger, BigInteger, BigInteger, String, BigInteger>(
                (BigInteger) results.get(0).getValue(), 
                (BigInteger) results.get(1).getValue(), 
                (BigInteger) results.get(2).getValue(), 
                (String) results.get(3).getValue(), 
                (BigInteger) results.get(4).getValue());
    }

    public TransactionReceipt addHouse(String _homeOwner, String _infor) {
        final Function function = new Function(
                FUNC_ADDHOUSE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_homeOwner), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_infor)), 
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void addHouse(String _homeOwner, String _infor, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_ADDHOUSE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_homeOwner), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_infor)), 
                Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForAddHouse(String _homeOwner, String _infor) {
        final Function function = new Function(
                FUNC_ADDHOUSE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_homeOwner), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_infor)), 
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple2<String, String> getAddHouseInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_ADDHOUSE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Utf8String>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple2<String, String>(

                (String) results.get(0).getValue(), 
                (String) results.get(1).getValue()
                );
    }

    public Tuple1<BigInteger> getAddHouseOutput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getOutput();
        final Function function = new Function(FUNC_ADDHOUSE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple1<BigInteger>(

                (BigInteger) results.get(0).getValue()
                );
    }

    public TransactionReceipt delHouse(BigInteger _id) {
        final Function function = new Function(
                FUNC_DELHOUSE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_id)), 
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void delHouse(BigInteger _id, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_DELHOUSE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_id)), 
                Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForDelHouse(BigInteger _id) {
        final Function function = new Function(
                FUNC_DELHOUSE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_id)), 
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple1<BigInteger> getDelHouseInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_DELHOUSE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple1<BigInteger>(

                (BigInteger) results.get(0).getValue()
                );
    }

    public Tuple1<BigInteger> getDelHouseOutput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getOutput();
        final Function function = new Function(FUNC_DELHOUSE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple1<BigInteger>(

                (BigInteger) results.get(0).getValue()
                );
    }

    public TransactionReceipt addOrder(BigInteger _rentInfor, BigInteger _time, String _tenant, BigInteger _houseId) {
        final Function function = new Function(
                FUNC_ADDORDER, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_rentInfor), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_time), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_tenant), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_houseId)), 
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void addOrder(BigInteger _rentInfor, BigInteger _time, String _tenant, BigInteger _houseId, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_ADDORDER, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_rentInfor), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_time), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_tenant), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_houseId)), 
                Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForAddOrder(BigInteger _rentInfor, BigInteger _time, String _tenant, BigInteger _houseId) {
        final Function function = new Function(
                FUNC_ADDORDER, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_rentInfor), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_time), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_tenant), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_houseId)), 
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple4<BigInteger, BigInteger, String, BigInteger> getAddOrderInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_ADDORDER, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}, new TypeReference<Uint256>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple4<BigInteger, BigInteger, String, BigInteger>(

                (BigInteger) results.get(0).getValue(), 
                (BigInteger) results.get(1).getValue(), 
                (String) results.get(2).getValue(), 
                (BigInteger) results.get(3).getValue()
                );
    }

    public Tuple1<BigInteger> getAddOrderOutput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getOutput();
        final Function function = new Function(FUNC_ADDORDER, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple1<BigInteger>(

                (BigInteger) results.get(0).getValue()
                );
    }

    public TransactionReceipt updOrder(BigInteger _id, BigInteger _rentInfor, BigInteger _time) {
        final Function function = new Function(
                FUNC_UPDORDER, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_id), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_rentInfor), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_time)), 
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void updOrder(BigInteger _id, BigInteger _rentInfor, BigInteger _time, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_UPDORDER, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_id), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_rentInfor), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_time)), 
                Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForUpdOrder(BigInteger _id, BigInteger _rentInfor, BigInteger _time) {
        final Function function = new Function(
                FUNC_UPDORDER, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_id), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_rentInfor), 
                new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_time)), 
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple3<BigInteger, BigInteger, BigInteger> getUpdOrderInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_UPDORDER, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}, new TypeReference<Uint256>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple3<BigInteger, BigInteger, BigInteger>(

                (BigInteger) results.get(0).getValue(), 
                (BigInteger) results.get(1).getValue(), 
                (BigInteger) results.get(2).getValue()
                );
    }

    public Tuple1<BigInteger> getUpdOrderOutput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getOutput();
        final Function function = new Function(FUNC_UPDORDER, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple1<BigInteger>(

                (BigInteger) results.get(0).getValue()
                );
    }

    public TransactionReceipt updHouse(BigInteger _id, String _infor) {
        final Function function = new Function(
                FUNC_UPDHOUSE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_id), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_infor)), 
                Collections.<TypeReference<?>>emptyList());
        return executeTransaction(function);
    }

    public void updHouse(BigInteger _id, String _infor, TransactionCallback callback) {
        final Function function = new Function(
                FUNC_UPDHOUSE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_id), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_infor)), 
                Collections.<TypeReference<?>>emptyList());
        asyncExecuteTransaction(function, callback);
    }

    public String getSignedTransactionForUpdHouse(BigInteger _id, String _infor) {
        final Function function = new Function(
                FUNC_UPDHOUSE, 
                Arrays.<Type>asList(new org.fisco.bcos.sdk.abi.datatypes.generated.Uint256(_id), 
                new org.fisco.bcos.sdk.abi.datatypes.Utf8String(_infor)), 
                Collections.<TypeReference<?>>emptyList());
        return createSignedTransaction(function);
    }

    public Tuple2<BigInteger, String> getUpdHouseInput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getInput().substring(10);
        final Function function = new Function(FUNC_UPDHOUSE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}, new TypeReference<Utf8String>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple2<BigInteger, String>(

                (BigInteger) results.get(0).getValue(), 
                (String) results.get(1).getValue()
                );
    }

    public Tuple1<BigInteger> getUpdHouseOutput(TransactionReceipt transactionReceipt) {
        String data = transactionReceipt.getOutput();
        final Function function = new Function(FUNC_UPDHOUSE, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint256>() {}));
        List<Type> results = FunctionReturnDecoder.decode(data, function.getOutputParameters());
        return new Tuple1<BigInteger>(

                (BigInteger) results.get(0).getValue()
                );
    }

    public List<AddHouseEventResponse> getAddHouseEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(ADDHOUSE_EVENT, transactionReceipt);
        ArrayList<AddHouseEventResponse> responses = new ArrayList<AddHouseEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            AddHouseEventResponse typedResponse = new AddHouseEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.name = (String) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.id = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public void subscribeAddHouseEvent(String fromBlock, String toBlock, List<String> otherTopics, EventCallback callback) {
        String topic0 = eventEncoder.encode(ADDHOUSE_EVENT);
        subscribeEvent(ABI,BINARY,topic0,fromBlock,toBlock,otherTopics,callback);
    }

    public void subscribeAddHouseEvent(EventCallback callback) {
        String topic0 = eventEncoder.encode(ADDHOUSE_EVENT);
        subscribeEvent(ABI,BINARY,topic0,callback);
    }

    public List<DelHouseEventResponse> getDelHouseEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(DELHOUSE_EVENT, transactionReceipt);
        ArrayList<DelHouseEventResponse> responses = new ArrayList<DelHouseEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            DelHouseEventResponse typedResponse = new DelHouseEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.name = (String) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.id = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public void subscribeDelHouseEvent(String fromBlock, String toBlock, List<String> otherTopics, EventCallback callback) {
        String topic0 = eventEncoder.encode(DELHOUSE_EVENT);
        subscribeEvent(ABI,BINARY,topic0,fromBlock,toBlock,otherTopics,callback);
    }

    public void subscribeDelHouseEvent(EventCallback callback) {
        String topic0 = eventEncoder.encode(DELHOUSE_EVENT);
        subscribeEvent(ABI,BINARY,topic0,callback);
    }

    public List<UpdHouseEventResponse> getUpdHouseEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(UPDHOUSE_EVENT, transactionReceipt);
        ArrayList<UpdHouseEventResponse> responses = new ArrayList<UpdHouseEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            UpdHouseEventResponse typedResponse = new UpdHouseEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.name = (String) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.id = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse._information = (String) eventValues.getNonIndexedValues().get(3).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public void subscribeUpdHouseEvent(String fromBlock, String toBlock, List<String> otherTopics, EventCallback callback) {
        String topic0 = eventEncoder.encode(UPDHOUSE_EVENT);
        subscribeEvent(ABI,BINARY,topic0,fromBlock,toBlock,otherTopics,callback);
    }

    public void subscribeUpdHouseEvent(EventCallback callback) {
        String topic0 = eventEncoder.encode(UPDHOUSE_EVENT);
        subscribeEvent(ABI,BINARY,topic0,callback);
    }

    public List<AddOrderEventResponse> getAddOrderEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(ADDORDER_EVENT, transactionReceipt);
        ArrayList<AddOrderEventResponse> responses = new ArrayList<AddOrderEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            AddOrderEventResponse typedResponse = new AddOrderEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.name = (String) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.info = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.id = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse._houseId = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
            typedResponse._rent = (BigInteger) eventValues.getNonIndexedValues().get(4).getValue();
            typedResponse._time = (BigInteger) eventValues.getNonIndexedValues().get(5).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public void subscribeAddOrderEvent(String fromBlock, String toBlock, List<String> otherTopics, EventCallback callback) {
        String topic0 = eventEncoder.encode(ADDORDER_EVENT);
        subscribeEvent(ABI,BINARY,topic0,fromBlock,toBlock,otherTopics,callback);
    }

    public void subscribeAddOrderEvent(EventCallback callback) {
        String topic0 = eventEncoder.encode(ADDORDER_EVENT);
        subscribeEvent(ABI,BINARY,topic0,callback);
    }

    public List<UpdOrderEventResponse> getUpdOrderEvents(TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = extractEventParametersWithLog(UPDORDER_EVENT, transactionReceipt);
        ArrayList<UpdOrderEventResponse> responses = new ArrayList<UpdOrderEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            UpdOrderEventResponse typedResponse = new UpdOrderEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.info = (String) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.id = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse._rentInfor = (BigInteger) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse._time = (BigInteger) eventValues.getNonIndexedValues().get(3).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public void subscribeUpdOrderEvent(String fromBlock, String toBlock, List<String> otherTopics, EventCallback callback) {
        String topic0 = eventEncoder.encode(UPDORDER_EVENT);
        subscribeEvent(ABI,BINARY,topic0,fromBlock,toBlock,otherTopics,callback);
    }

    public void subscribeUpdOrderEvent(EventCallback callback) {
        String topic0 = eventEncoder.encode(UPDORDER_EVENT);
        subscribeEvent(ABI,BINARY,topic0,callback);
    }

    public static RentHouse load(String contractAddress, Client client, CryptoKeyPair credential) {
        return new RentHouse(contractAddress, client, credential);
    }

    public static RentHouse deploy(Client client, CryptoKeyPair credential) throws ContractException {
        return deploy(RentHouse.class, client, credential, getBinary(client.getCryptoSuite()), "");
    }

    public static class AddHouseEventResponse {
        public TransactionReceipt.Logs log;

        public String name;

        public String info;

        public BigInteger id;
    }

    public static class DelHouseEventResponse {
        public TransactionReceipt.Logs log;

        public String name;

        public String info;

        public BigInteger id;
    }

    public static class UpdHouseEventResponse {
        public TransactionReceipt.Logs log;

        public String name;

        public String info;

        public BigInteger id;

        public String _information;
    }

    public static class AddOrderEventResponse {
        public TransactionReceipt.Logs log;

        public String name;

        public String info;

        public BigInteger id;

        public BigInteger _houseId;

        public BigInteger _rent;

        public BigInteger _time;
    }

    public static class UpdOrderEventResponse {
        public TransactionReceipt.Logs log;

        public String info;

        public BigInteger id;

        public BigInteger _rentInfor;

        public BigInteger _time;
    }
}
